package com.ruibang.glass.produce.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.ruibang.glass.common.utils.validateannotation.NotBlank;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-03-11  14:41
 * @Description: TODO:生产-原材料领料实体
 * @Version: 1.0
 */
@Data
@ApiModel
@TableName(value = "g_produce_raw_material_receive")
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
public class RawMaterialReceive extends BaseEntity {

    @ApiModelProperty(value = "主键id")
    @TableId(value = "material_receive_id", type = IdType.ASSIGN_ID)
    @ExcelIgnore
    private String materialReceiveId;

    @ApiModelProperty("申请单号")
    @TableField("order_no")
    private String orderNo;

    @ApiModelProperty("配料系统")
    @NotBlank(message = "配料系统不可为空")
    private String system;

    @ApiModelProperty("出库类型")
    @NotBlank(message = "出库类型不可为空")
    @TableField("outbound_type")
    private String outboundType;

    @ApiModelProperty("物品类型")
    @NotBlank(message = "物品类型不可为空")
    @TableField("item_type")
    private String itemType;

    @ApiModelProperty("物品类型名称")
    @TableField("item_type_name")
    private String itemTypeName;

    @ApiModelProperty("出库用途")
    @NotNull(message = "出库用途不可为空")
    private String outboundPurpose;

    @ApiModelProperty("仓库名称")
    @NotBlank(message = "仓库名称不可为空")
    private String warehouseName;

    @ApiModelProperty("仓库Id")
    @NotBlank(message = "仓库ID不可为空")
    private String warehouseId;

    @ApiModelProperty("计划领料人名称")
    @TableField("plan_picker")
    private String planPicker;

    @ApiModelProperty("计划领料人用户ID")
    @NotBlank(message = "计划领料人不可为空")
    private String planPickerId;

    @ApiModelProperty("计划时间")
    @NotNull(message = "计划时间不可为空")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime planTime;

    @ApiModelProperty("领料部门ID")
    @NotNull(message = "领料部门ID不可为空")
    private String deptId;

    @ApiModelProperty("创建人用户名称")
    private String createBy;

    @ApiModelProperty("创建人用户ID")
    @NotNull(message = "创建人不可为空")
    private String createById;

    @ApiModelProperty(value = "审批状态")
    private String approveStatus;

    @ApiModelProperty(value = "当前审批人名称")
    @TableField(exist = false)
    private String currentAuditBy;

    @ApiModelProperty(value = "当前审批人ID")
    @TableField(exist = false)
    private String approveUserId;

    @ApiModelProperty(value = "当前节点名称")
    @TableField(exist = false)
    private String nodeName;

    @ApiModelProperty(value = "当前节点Key")
    @TableField(exist = false)
    private String nodeKey;

    @ApiModelProperty(value = "流程实例Id")
    @TableField(exist = false)
    private String processInstanceId;

    @ApiModelProperty(value = "是否删除：1：是 0：否")
    @TableLogic
    @ExcelIgnore
    private String isDelete;

    @ApiModelProperty(value = "申请物品信息")
    @TableField(exist = false)
    @NotEmpty(message = "物品信息不可为空")
    @Valid
    private List<MaterialItemInfo> materialItemInfo;

    @ApiModelProperty(value = "菜单ID")
    @TableField(exist = false)
    private String menuId;
}
